
<?php
header("Content-type:application/json; charset=UTF-8"); 
include "../connect.php";
//show data head
$sql_new =mysql_query("(SELECT na.c_id,na.c_section,n.c_id,n.c_category,n.c_public,n.c_title,n.c_post_on
from smm_news_category na left join smm_news n on na.c_id = n.c_category 
where  na.c_section='woman' and n.c_public='1' order by n.c_post_on DESC limit 0,3)
UNION
(SELECT ca.c_id,ca.c_section,a.c_id,a.c_category,a.c_public,a.c_title,a.c_post_on
from smm_article_category ca left join smm_article a on ca.c_id = a.c_category
where  ca.c_section='woman' and a.c_public ='1' order by a.c_post_on DESC limit 0,3)
");

while($rs=mysql_fetch_array($sql_new)){
	$json_data[d_new][]=array("c_id"=>$rs['c_id'],"c_title"=>$rs['c_title']);
}
echo json_encode($json_data);
?>